Description:
for loops are the most complex loops. They behave similar to their C counterparts.
The first expression (expr1) is evaluated (executed) once unconditionally at the beginning of the loop.
In the beginning of each iteration, expr2 is evaluated. If it evaluates to
true, the loop continues and the nested statement(s) are executed. If it evaluates to
false, the execution of the loop ends.
At the end of each iteration, expr3 is evaluated (executed).
Each of the expressions can be empty. expr2 being empty means the loop should be run indefinitely (PHP implicitly considers it as
true, like C). This may not be as useless as you might think, since often you'd want to end the loop using a conditional
break statement instead of using the for truth expression.